package com.lf.lexy.business.rec;

import java.util.ArrayList;
import java.util.List;

import com.jfinal.plugin.activerecord.Page;
import com.lf.lexy.dao.BlogContentDao;
import com.lf.lexy.model.BlogContent;

public class BlogBusiness {
	
	
	
	
	  
	/**  
	* @Title: getBlogContentList  
	* @Description: 首页获取list title
	* @param @param userNo
	* @param @param typeNo
	* @param @param pageNumber
	* @param @param pagesize
	* @param @return
	* @return Page<BlogContent>
	* @author lxliufei
	* @date 下午6:25:35
	* @throws  
	*/  
	    
	public Page<BlogContent> getBlogContentList(String userNo , String typeNo ,  String pageNumber , int pagesize){
		Page<BlogContent> blogContentList = BlogContentDao.me.getBlogContentList(userNo, typeNo, pageNumber , pagesize);
		
		List<BlogContent> list = blogContentList.getList();
		
		List<BlogContent> exeList = new ArrayList<BlogContent>();
		if(list!=null && list.size()>0){
			
			for (BlogContent blogContent : list) {
				String blogContent2 = blogContent.getBlogContent();
				if(blogContent2.length()>50){
					blogContent.setBlogContent(blogContent2.substring(50)+"......");
				}
				exeList.add(blogContent);
			}
		}
		return	new Page<BlogContent>(exeList, blogContentList.getPageNumber(), blogContentList.getPageSize(), blogContentList.getTotalPage(), blogContentList.getTotalRow());
		
	}

}
